<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>修改用户信息</title>
</head>
<body>

   <a href="#">修改用户信息</a>
     
    <form>
      <input type="hidden" value="{$user['id']}" id="user_id" />
      <label>
        用户：
        <input type="text" name="user_name" id="user_name" value="{$user['user_name']}"/>
      </label>
      <br/>
      <label>
        密码：
        <input type="text" name="user_pass" id="user_pass" value="{$user['user_pass']}" />
      </label>


      <br/>
      <label>
        邮箱：
        <input type="text" name="user_email" id="user_email" value="{$user['user_email']}" />
      </label>
      <br/>

      <label>
        地址：
        <input type="text" name="user_address" id="user_address" value="{$user['user_address']}" />
      </label>
      <br/>
      <label>
        电话：
        <input type="text" name="user_phone" id="user_phone" value="{$user['user_phone']}" />
      </label>


      <br/>
      <label>
        性别：
        <input type="text" name="user_sex" id="user_sex"  value="{$user['user_sex']}" />
      </label>
      <br/>
      
      <label>
        年龄：
        <input type="text" name="user_age" id="user_age" value="{$user['user_age']}" />
      </label>
      <br/>
      

       <div style="width:100px;height:30px;background:#ccc;margin:30px;text-align:center;line-height:30px;" id="user_update" >修改</div>
    </form>


</body>
</html>
<script type="text/javascript" src="__PUBLIC__/js/jquery-2.1.0.js"></script>
<script type="text/javascript">
  

     $('#user_update').on('click',function(){
          
          //收集数据
          var data = {
              id:$("#user_id").val(),
              user_name:$("#user_name").val(),
              user_pass:$("#user_pass").val(),
              user_email:$("#user_email").val(),
              user_address:$("#user_address").val(),
              user_phone:$("#user_phone").val(),
              user_sex:$("#user_sex").val(),
              user_age:$("#user_age").val(),
          }



            //接收数据，展示在页面
            var url = '{:U("user_update")}';
         

            $.post(url,data,function(res){
                if(res.status==1){
                    alert(res.msg);
                    window.location.href = "{:U('user_list')}";
                }else{
                    alert(res.msg);
                }


            });

     });



   


  

	
</script>




























